import { Title } from '@shared/ui/Title'
import { ReactNode } from 'react'
import styles from './MenuTitle.module.scss'

interface MenuTitleProps {
  renderButton?: () => ReactNode
  title: string
}

export const MenuTitle = ({ renderButton, title }: MenuTitleProps) => {
  return (
    <div className={styles['title-wrap']}>
      <Title className={styles['title']} tag='h5'>
        {title}
      </Title>
      {renderButton?.()}
    </div>
  )
}

MenuTitle.displayName = 'MenuTitle'
